{$CLEO .cs}
{$use cleo+}
0000:

model.Load(#SAWNOFF) 
model.Load(#WMYAMMO) 
model.Load(#SNIPER) 
model.Load(#M4) 
model.Load(#MP5LNG) 
model.Load(#DESERT_EAGLE) 
model.Load(#SHOTGSPA) 
038B: load_requested_models

CONST
 STEALING_WEAPONS  = 9@
  WEAPON1  = 10@
  WEAPON2  = 11@
  WEAPON3  = 12@
  WEAPON4  = 13@
  WEAPON5  = 14@
  WEAPON6  = 15@
  WEAPON7  = 16@      
END 
STEALING_WEAPONS = FALSE 
    if not marker_enabled 1@
    then
       1@ = marker.CreateIconWithoutSphere(6,  745.7484, -1134.2427, 24.2687)
    end
    32@ = 1000000
while $onmission >= 1   
wait 0         
    if and
    32@ >  8000
    00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere 745.7484 -1134.2427 24.2687 radius 8.0 8.0 1.5
    then
        0ACA: show_text_box "M4 - $2500~n~Sniper - $10000~n~Combat Shotgun - $5000~n~MP5 - $1000~n~Desert Eagle - $500"
        if STEALING_WEAPONS == true
        then
          0ACA: show_text_box "Your not welcome in the store anymore."
           $crime_rate += 60.0
        end
        32@ = 0 
    end 
    if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  745.7484 -1134.2427 24.2687 radius 100.0 100.0 100.0
    then
        if not is_actor_defined 0@
        then

             0@ = actor.Create(4 , #WMYAMMO , 745.7484, -1134.2427, 24.2687)     
             actor.Angle( 0@  ) =296.778 
             actor.Health( 0@ ) = 4000
             0446: set_actor 0@ dismemberment_possible 0 
             0946: set_actor 0@ actions_uninterupted_by_weapon_fire 1
             0638: AS_actor 0@ stay_put 1
             03FE: set_actor 0@ money 5000

             marker.CreateAboveActor(2@, 0@ )
             07E0: set_marker 2@ type_to 1
             018B: set_marker 2@ radar_mode 2
             
             IF AND 
              89D1: NOT   pickup WEAPON1 created
              89D1: NOT   pickup WEAPON2 created
              89D1: NOT   pickup WEAPON3 created
              89D1: NOT   pickup WEAPON4 created
              89D1: NOT   pickup WEAPON5 created 
             THEN
                032B: WEAPON1 = create_weapon_pickup #M4 group 15 ammo 500 at  750.3932 -1134.6388 24.1377
                032B: WEAPON2 = create_weapon_pickup #SNIPER group 15 ammo 250 at   755.9605 -1134.0664 24.1217
                032B: WEAPON3 = create_weapon_pickup #SHOTGSPA group 15 ammo 200 at  745.9135 -1128.8346 24.837 
                032B: WEAPON4 = create_weapon_pickup #MP5LNG group 15 ammo 250 at 749.3757 -1122.8931 24.8537 
                032B: WEAPON5 = create_weapon_pickup #DESERT_EAGLE group 15 ammo 150 at 752.4726 -1117.7544 24.7841


             END 
             wait 100   
        end 
    else
        
        if is_actor_defined  0@
        then
            actor.DestroyInstantly( 0@ )
        end 
        IF AND
        09D1:   pickup WEAPON1 created
        09D1:   pickup WEAPON2 created
        09D1:   pickup WEAPON3 created
        09D1:   pickup WEAPON4 created
        09D1:   pickup WEAPON5 created 
        THEN
           PICKUP.Destroy(WEAPON1)
           PICKUP.Destroy(WEAPON2)
           PICKUP.Destroy(WEAPON3)
           PICKUP.Destroy(WEAPON4)
           PICKUP.Destroy(WEAPON5)
        
        END 

            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end        
        wait 100
    end 



    //WEAPON CHECK
    IF AND
    09D1:   pickup WEAPON1 created
    09D1:   pickup WEAPON2 created
    09D1:   pickup WEAPON3 created
    09D1:   pickup WEAPON4 created
    09D1:   pickup WEAPON5 created 
    
    THEN
        IF PICKUP.Picked_up(WEAPON1)     //M4
        THEN
            IF 810A:  NOT player $PLAYER_CHAR money > 2500
            THEN 
                STEALING_WEAPONS = TRUE 
               $crime_rate += 30.0
            END
            0109: player $PLAYER_CHAR money  -2500
        END
        IF PICKUP.Picked_up(WEAPON2)     //SNIPER
        THEN
            IF 810A:  NOT player $PLAYER_CHAR money > 10000
            THEN 
                STEALING_WEAPONS = TRUE 
              $crime_rate += 100.0
            END
            0109: player $PLAYER_CHAR money  -10000
        END
        IF PICKUP.Picked_up(WEAPON3)     //SHOTGUN
        THEN
            IF 810A:  NOT player $PLAYER_CHAR money > 5000
            THEN 
                STEALING_WEAPONS = TRUE 
              $crime_rate += 50.0
            END
            0109: player $PLAYER_CHAR money  -5000
        END
        IF PICKUP.Picked_up(WEAPON4)     //MP5
        THEN
            IF 810A:  NOT player $PLAYER_CHAR money > 1000
            THEN 
                STEALING_WEAPONS = TRUE 
               $crime_rate += 20.0
            END
            0109: player $PLAYER_CHAR money  -1000
        END
        IF PICKUP.Picked_up(WEAPON5)     //PISTOL
        THEN
            IF 810A:  NOT player $PLAYER_CHAR money > 500
            THEN 
                STEALING_WEAPONS = TRUE 
                $crime_rate += 10.0
            END
            0109: player $PLAYER_CHAR money  -500
        END
    END     
    
    //clerk
    if is_actor_defined 0@
    then
        
        if actor.Dead(0@)
        then
            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end     
        else
            if  or
            051A:   actor 0@ damaged_by_actor $PLAYER_ACTOR
            STEALING_WEAPONS == true 
            then
                054E: clear_actor 0@ damage

            {
                if $WAVE < 2
                then
                    $WAVE = 2 
                end    }
                //hostile
            //    0467: clear_actor 0@ last_weapon_damage

                actor.GiveWeaponAndAmmo(0@, Sawnoff , 99999)
                081A: set_actor 0@ weapon_skill_to 2 
                actor.WeaponAccuracy(0@)= 80
                07DD: set_actor 0@ attack_rate 100 // previously known as temper_to
                077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
                077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
                077A: set_actor 0@ acquaintance 4 to_actors_pedtype 8 // see ped.dat
                07FE: set_actor 0@ fighting_style_to 7 moves 6
                0638: AS_actor 0@ stay_put 0 
                 if marker_enabled  2@
                 then
                 07E0: set_marker 2@ type_to 0
                 end 
            end
        
         
        end
     
         
    end 
end 
//Cleanup 
if is_actor_defined  0@
then
    actor.DestroyInstantly( 0@ )
end 
if  marker_enabled 1@
then
marker.Disable(1@ )
end        
if  marker_enabled 2@
then
marker.Disable(2@ )
end       
        IF AND
        09D1:   pickup WEAPON1 created
        09D1:   pickup WEAPON2 created
        09D1:   pickup WEAPON3 created
        09D1:   pickup WEAPON4 created
        09D1:   pickup WEAPON5 created 
        THEN
           PICKUP.Destroy(WEAPON1)
           PICKUP.Destroy(WEAPON2)
           PICKUP.Destroy(WEAPON3)
           PICKUP.Destroy(WEAPON4)
           PICKUP.Destroy(WEAPON5)
        
        END 
model.destroy(#SAWNOFF) 
model.destroy(#WMYAMMO) 
model.destroy(#SNIPER) 
model.destroy(#M4) 
model.destroy(#MP5LNG) 
model.destroy(#DESERT_EAGLE) 
model.destroy(#SHOTGSPA) 
terminate_this_custom_script